﻿namespace System.Lua.Tests
{
    public class StatusDetails : IEquatable<StatusDetails>
    {
        public int RepliedTo { get; set; }
        public string Text { get; set; }
        public DateTime StatusUpdated { get; set; }
        public User User { get; set; }

        public bool Equals(StatusDetails other)
        {
            if (ReferenceEquals(null, other))
                return false;
            if (ReferenceEquals(this, other))
                return true;
            return other.RepliedTo == RepliedTo && Equals(other.Text, Text) && other.StatusUpdated.Equals(StatusUpdated) && Equals(other.User, User);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj))
                return false;
            if (ReferenceEquals(this, obj))
                return true;
            if (obj.GetType() != typeof(StatusDetails))
                return false;
            return Equals((StatusDetails)obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                int result = RepliedTo;
                result = (result * 397) ^ (Text != null ? Text.GetHashCode() : 0);
                result = (result * 397) ^ StatusUpdated.GetHashCode();
                result = (result * 397) ^ (User != null ? User.GetHashCode() : 0);
                return result;
            }
        }
    }
}
